import { useSelector, useDispatch } from 'react-redux'
import { setCount } from "@/store"
import { Store } from "@/store";

function User() {
  const count = useSelector<Store, number>(state => state.user.count)
  const dispatch = useDispatch()
  
  const handleClick = () => {
    dispatch(setCount(count + 1))
  }

  return (
    <>
        <div onClick={()=>{handleClick}}>
            hello world{count}
        </div>
    </>
  )
}

export default User
